@include b('file-upload') {
  display: flex;
  flex-direction: column;
  width: 100%;

  // 预览自己绘制
  .van-uploader__preview {
    display: none;
  }

  .van-uploader {
    width: 100%;
  }

  @include b('file-upload-button') {
    width: rem(20px);
    height: rem(20px);
    font-size: getCssVar('font-size', header-4);
    color: getCssVar('color', 'text', 2);
    background: transparent;
    border: none;
    border-radius: 50%;
  }

  .van-uploader__preview {
    .van-uploader__file-icon {
      display: none;
    }

    .van-uploader__file-name {
      display: none;
    }
  }

  @include b(file-upload-item-cover) {
    position: absolute;
    top: 0;
    bottom: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: rem(12px);
    line-height: initial;
    color: #fff;
    text-align: center;
    background: getCssVar(color, overlay, bg);
  }

  @include b(file-upload-preview) {
    width: 100%;
    margin-top: rem(10px);
  }

  @include b(file-upload-preview-item) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 getCssVar('spacing', 'tight');
    margin-bottom: getCssVar('spacing', 'tight');
    background: getCssVar(color, disabled, bg);
    border-radius: getCssVar('border-radius', 'small');

    &:last-child {
      margin: 0;
      border-width: 0;
    }
  }

  @include b(file-upload-preview-item-img) {
    flex-shrink: 0;
    width: rem(40px);
    min-width: rem(40px);
    height: rem(40px);
    padding: rem(6px);

    img {
      width: 100%;
      height: 100%;
      border-radius: rem(4px);
    }
  }

  @include b(file-upload-preview-item-left) {
    display: flex;
    flex-grow: 1;
    align-items: center;
    width: calc(100% - #{rem(20px)});
  }

  @include b(file-upload-preview-item-text) {
    display: flex;
    flex: 1;
    align-items: center;
    width: calc(100% - #{rem(40px)});
    padding-left: getCssVar('spacing', 'tight');
    font-size: rem(14px);
  }

  @include b(file-upload-preview-item-name) {
    @include utils-ellipsis;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  @include b(file-upload-preview-item-action) {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    width: rem(20px);
    color: getCssVar(color, overlay, bg);
    text-align: right;
  }

  .van-uploader__input-wrapper {
    width: 100%;
    text-align: right;
    input {
      right: 0;
      left: auto;
      width: 1.25rem;
    }
  }

}

@include b(form-item-container) {
  @include m(top) {
    @include b('file-upload') {
      .van-uploader {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
      }
    }
  }
}

@include b('file-upload') {
  @include m(readonly) {
    @include b(file-upload-preview) {
      margin-top: 0;
    }
  }
}

@include b('file-upload') {
  @include m(disabled) {
    @include b(file-upload-preview) {
      margin-top: 0;
    }
  }
}